using System;
using System.Collections.Generic;
using Dict.DataModel;

namespace Dict.Dao
{
    public class TableDailyCopyChapterDao:DaoBase<TableDailyCopyChapter>
    {
        public override void AddPrimaryIndex(TableDailyCopyChapter model)
        {
            cachePrimary[model.ChapterId.ToString()] = model;
        }

        public override string GetFileName()
        {
            return "TableDailyCopyChapter.txt";
        }

        protected override TableDailyCopyChapter ParseRowData(string[] rowData)
        {
            TableDailyCopyChapter data = new TableDailyCopyChapter();
			data.ChapterId = rowData [0];

            if (string.IsNullOrEmpty(rowData[1]))
            {
                data.LevelLimit = 0;
            }
            else
            {
                data.LevelLimit = int.Parse(rowData[1]);
            }

            if (string.IsNullOrEmpty(rowData[2]))
            {
                data.Recommend = 0;
            }
            else
            {
                data.Recommend = int.Parse(rowData[2]);
            }
			data.Drop = rowData [3];
			data.Type = rowData [4];

            return data;
        }



    }

}
